<template>
  <el-date-picker
    v-model="dateTimeValue"
    class="nw-date-picker"
    type="date"
    :placeholder="getPlaceholder()"
    format="YYYY-MM-DD"
    value-format="YYYY-MM-DD"
    :clearable="clearable"
    :="$attrs"
  />
</template>

<script setup>
const props = defineProps({
  pickerType: {
    type: String,
    default: '1' // 1-没有快捷选项，2-有最近一周/最近一个月的快捷选项
  },
  placeholder: {
    type: String,
    default: ''
  },
  label: {
    type: String,
    default: ''
  },
  clearable: {
    type: Boolean,
    default: true
  }
})

const dateTimeValue = defineModel({
  type: String,
  default: ''
})
// const disabledDate = time => {
//   return time.getTime() > +new Date()
// }
const getPlaceholder = _ => {
  return (
    props.placeholder ||
    g_rules.zhAndEnShowMsg(g_t('public.pleaseSelect'), props.label)
  )
}
</script>

<style scoped lang="scss">
.nw-date-picker {
  width: 200px;
}
</style>
